import request from '@/config/axios'

export interface MaterialVO {
  id: number
  title: string
  picUrl: string
  videoUrl: string
  browseCount: string
  sort: number
  status: boolean //是否收费
  content: string
}

// 查询文章管理列表
export const getMaterialPage = async (params: any) => {
  return await request.get({ url: `/product/spu-video/page`, params })
}

// 查询文章管理详情
export const getMaterial = async (id: number) => {
  return await request.get({ url: `/product/spu-video/get?id=` + id })
}

// 新增文章管理
export const createMaterial = async (data: MaterialVO) => {
  return await request.post({ url: `/product/spu-video/create`, data })
}

// 修改文章管理
export const updateMaterial = async (data: MaterialVO) => {
  return await request.put({ url: `/product/spu-video/update`, data })
}

// 删除文章管理
export const deleteMaterial = async (id: number) => {
  return await request.delete({ url: `/product/spu-video/delete?id=` + id })
}
